/**
 * Created by changshuiwang on 2016/7/26.
 */
$(function(){
    $("#AddForm").submit(function(){
        var data=$(this).serialize();
        $.ajax({
            url:"/site/add",
            type:"POST",
            data:data,
            dataType:"json",
            success:function(msg)
            {
                console.log(msg);
                if(msg.status=="success"){
                    alert("添加成功");
                    window.location.href="/site/info";
                }else{
                    alert(msg.error);
                }
            }
        });
        return false;
    });
})